package com.example.demo.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-01-06
 * Time: 21:14
 */

@Controller
public class WebController1 {

    /**
     * 请求转发->地址不会改变
     * @return
     */
    @RequestMapping(value = "/hello1")
    public Object hello1() {
        return "forward:/login.html";
    }

    /**
     * 请求重定向->地址会改变
     */
    @RequestMapping("/hello2")
    public Object hello2() {
        return "redirect:/index.html";
    }

}